package info.yangguo.service;

import info.yangguo.pojo.ResponseType;
import info.yangguo.util.HexUtil;
import info.yangguo.util.Transfer;

/**
 * @author:杨果
 * @date:16/10/1 下午12:20
 *
 * Description:
 *
 */
public class EncodeResponse {
    public static byte[] encode(String phoneNo, int serialNo, ResponseType responseType) {
        String value = Transfer.encodeResponseType(responseType);
        value = Transfer.encodeSerialNo(serialNo, value);
        value = Transfer.encodePhoneNo(phoneNo, value);
        value = "FF" + value;
        value = Transfer.encodeVerify(value);
        value = Transfer.encodeTransferred(value);
        value = Transfer.encodeIdentifier(value);

        return HexUtil.decodeHex(value.toCharArray());
    }
}
